<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>PCMS内容管理系统</title>
<link href="<?php echo $_tpl['css']; ?>admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<?php echo $_tpl['js']; ?>jquery.js"></script>
<script language="javascript" src="<?php echo $_tpl['js']; ?>cookie.js"></script>
<script language="javascript">
function check()
{
	var item = document.getElementById( "user" );

	if ( item.value == "" )
	{
		alert( "请输入帐号" );
		item.focus();
		return false;
	}

	item = document.getElementById( "passwd" );

	if ( item.value == "" )
	{
		alert( "请输入密码" );
		item.focus();
		return false;
	}

	item = document.getElementById( "code" );

	if ( item.value == "" )
	{
		alert( "请输入验证码" );
		item.focus();
		return false;
	}

	document.getElementById( "submit" ).disabled = true;

	$.ajax({
	type: "POST",
	url: "login.php",
	dataType: "json",
	data: "user=" + $( "#user" ).val() + "&passwd=" + $( "#passwd" ).val() + "&code=" + $( "#code" ).val(),
	success: function( data )
		{
			if ( data.success == 1 )
			{
				top.location.href = "index.php";
			}
			else
			{
				document.getElementById( "submit" ).disabled = false;
				alert( data.memo );
			}
		}
	});
}
</script>
</head>
<body class="admin_login_bg"onload="document.getElementById( 'user' ).focus()">
	<div class="admin_login margin_t100px">
		<div class="admin_title1"><img align="absmiddle" src="<?php echo $_tpl['images']; ?>admin_ico_1.jpg">登 录</div>
		<div class="admin_login_content bg_color1 padding20px">
			<div class="padding10px center">　 帐　号：<input size="25" name="user" id="user" type="text" onkeydown="if ( event.keyCode == 13 ) document.getElementById( 'passwd' ).focus()" /></div>
			<div class="padding10px center"  >　 密　码：<input size="25" name="passwd" id="passwd" type="password" onkeydown="if ( event.keyCode == 13 ) check()" /></div>
			<div class="padding10px center">　 验证码：<input size="12" name="code" id="code" type="text" onkeydown="if ( event.keyCode == 13 ) check()" /><img id="verifycode_img" src="verifycode.php?<?php echo microtime(); ?>" align="absmiddle"> <a class="a1" href="#" onclick="document.getElementById('verifycode_img').src='verifycode.php?'+Math.random()">刷新</a> </div>
			<div class="padding_t10px margin_t10px right border_t1"><input class="btn1" type="button" value="登 录" onclick="check()" id="submit" style="cursor:pointer;" /></div>
		</div>
	</div>
</body>
</html>